package cn.hn.yh.common;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;

public class DataStory {
    /**
     * 系统操作的负荷日志是否从0点开始。
     */
    public static final boolean DAY_LOAD_CURVE_START_WITH_ZERO = false;
    /* 96点负荷名称 */
    /* 96点负荷名称 */
    public static final String[] DAY_LOAD_96COLUMN = new String[96];
    public static final String[] DAY_LOAD_96COLUMN_NAME = new String[96];

    public static final String[] DAY_LOAD_96COLUMN_V = new String[96];
    public static final String[] DAY_LOAD_96COLUMN_NAME_V = new String[96];

    static {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HHmm");
        Calendar calendar = Calendar.getInstance();
        calendar.set(2019, 0, 1, 0, 0, 0);
        for (int i = 0; i < 96; i++) {
            String time = simpleDateFormat.format(calendar.getTime());
            if (!DAY_LOAD_CURVE_START_WITH_ZERO && "0000".equals(time)) {
                time = "2400";
            }
            DAY_LOAD_96COLUMN[i] = "T" + time;
            DAY_LOAD_96COLUMN_NAME[i] = time.substring(0, 2) + ":" + time.substring(2, 4);
            calendar.add(Calendar.MINUTE, 15);
            DAY_LOAD_96COLUMN_V[i] = "V" + (i + 1);
        }
        Arrays.sort(DAY_LOAD_96COLUMN);
        Arrays.sort(DAY_LOAD_96COLUMN_NAME);
    }
}
